Shell script [Expected end of line, etc. but found unknown token]
Posted
by rockinthesixstring
on Stack Overflow
See other posts from Stack Overflow
or by rockinthesixstring
Published on 2010-03-13T21:21:27Z
Indexed on
2010/03/13
21:55 UTC
Read the original article
Hit count: 438
shell-scripting
I'm trying to build a Synergy AutoStart script as per this article, the shell is giving me the error
Syntax Error
Expected end of line, etc. but found unknown token
Here is the script I'm working on...
#!/bin/sh
. /etc/rc.common
run=(/usr/local/bin/synergyc -n $(hostname -s) -1 -f 192.168.0.108)
KeepAlive ()
{
proc=${1##*/}
while [ -x "$1" ]
do
if ! ps axco command | grep -q "^${proc}\$"
then
"$@"
fi
sleep 3
done
}
StartService ()
{
ConsoleMessage "Starting Synergy"
KeepAlive "${run[@]}" &
}
StopService ()
{
return 0
}
RestartService ()
{
return 0
}
RunService "$1"
And when the error is thrown, the "period" is highlighted on this line . /etc/rc.common
Is there something I'm missing here?
© Stack Overflow or respective owner